package com.yundasys.lab02springbootstudy.propertyaccessor;

import java.util.List;

/**
 * @Title: Student
 * @Description:
 * @author: jiangta
 * @date: 2024/7/2 9:39 上午
 * @Version: 1.0
 */
public class Student {

    public String name;

    public String firstName;

    public String lastName;

    public Student girlFriend;

    public List<Student> friends;

    public void setFirstName(String firstName) {
        this.firstName = firstName;
        this.name = firstName + (lastName == null ? "" : lastName);
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
        this.name = (firstName == null ? "" : firstName) + lastName;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setGirlFriend(Student girlFriend) {
        this.girlFriend = girlFriend;
    }

    public void setFriends(List<Student> friends) {
        this.friends = friends;
    }

    public String getName() {
        return name;
    }

    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public Student getGirlFriend() {
        return girlFriend;
    }

    public List<Student> getFriends() {
        return friends;
    }
}